package com.ruoyi.net.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.net.domain.BusiL2VpnQoslevel;
import com.ruoyi.net.mapper.BusiL2VpnQoslevelMapper;
import com.ruoyi.net.service.IBusiL2VpnQoslevelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 业务-L2 VPN qos上下话优先级Service业务层处理
 * 
 * @author net
 * @date 2024-12-15
 */
@Service
public class BusiL2VpnQoslevelServiceImpl implements IBusiL2VpnQoslevelService 
{
    @Autowired
    private BusiL2VpnQoslevelMapper busiL2VpnQoslevelMapper;

    /**
     * 查询业务-L2 VPN qos上下话优先级
     * 
     * @param id 业务-L2 VPN qos上下话优先级主键
     * @return 业务-L2 VPN qos上下话优先级
     */
    @Override
    public BusiL2VpnQoslevel selectBusiL2VpnQoslevelById(String id)
    {
        return busiL2VpnQoslevelMapper.selectBusiL2VpnQoslevelById(id);
    }

    /**
     * 查询业务-L2 VPN qos上下话优先级列表
     * 
     * @param busiL2VpnQoslevel 业务-L2 VPN qos上下话优先级
     * @return 业务-L2 VPN qos上下话优先级
     */
    @Override
    public List<BusiL2VpnQoslevel> selectBusiL2VpnQoslevelList(BusiL2VpnQoslevel busiL2VpnQoslevel)
    {
        return busiL2VpnQoslevelMapper.selectBusiL2VpnQoslevelList(busiL2VpnQoslevel);
    }

    /**
     * 新增业务-L2 VPN qos上下话优先级
     * 
     * @param busiL2VpnQoslevel 业务-L2 VPN qos上下话优先级
     * @return 结果
     */
    @Override
    public int insertBusiL2VpnQoslevel(BusiL2VpnQoslevel busiL2VpnQoslevel)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(busiL2VpnQoslevel.getId())) {
            busiL2VpnQoslevel.setId(uuid);
        }
        busiL2VpnQoslevel.setCreateBy(SecurityUtils.getUsername());
        busiL2VpnQoslevel.setCreateTime(DateUtils.getNowDate());
        busiL2VpnQoslevel.setUpdateBy(SecurityUtils.getUsername());
        busiL2VpnQoslevel.setUpdateTime(DateUtils.getNowDate());
        return busiL2VpnQoslevelMapper.insertBusiL2VpnQoslevel(busiL2VpnQoslevel);
    }

    /**
     * 修改业务-L2 VPN qos上下话优先级
     * 
     * @param busiL2VpnQoslevel 业务-L2 VPN qos上下话优先级
     * @return 结果
     */
    @Override
    public int updateBusiL2VpnQoslevel(BusiL2VpnQoslevel busiL2VpnQoslevel)
    {
        busiL2VpnQoslevel.setUpdateBy(SecurityUtils.getUsername());
        busiL2VpnQoslevel.setUpdateTime(DateUtils.getNowDate());
        return busiL2VpnQoslevelMapper.updateBusiL2VpnQoslevel(busiL2VpnQoslevel);
    }

    /**
     * 批量删除业务-L2 VPN qos上下话优先级
     * 
     * @param ids 需要删除的业务-L2 VPN qos上下话优先级主键
     * @return 结果
     */
    @Override
    public int deleteBusiL2VpnQoslevelByIds(String[] ids)
    {
        return busiL2VpnQoslevelMapper.deleteBusiL2VpnQoslevelByIds(ids);
    }

    /**
     * 删除业务-L2 VPN qos上下话优先级信息
     * 
     * @param id 业务-L2 VPN qos上下话优先级主键
     * @return 结果
     */
    @Override
    public int deleteBusiL2VpnQoslevelById(String id)
    {
        return busiL2VpnQoslevelMapper.deleteBusiL2VpnQoslevelById(id);
    }
}
